<?php

namespace App\Http\Requests;

class MenuCreateRequest extends BaseRequest
{
    /**
     * Get the validation rules that apply to the request.
     * @return string[]
     */
    public function rules(): array
    {
        return [
            'title' => ['required','unique:admin_menus'],
            'name' => ['required','unique:admin_menus']
        ];
    }

    public function messages(): array
    {
        return [
            'title.required' => '菜单名不能为空',
            'title.unique' => '菜单名已存在',
            'name.required' => '菜单标识不能为空',
            'name.unique' => '菜单标识已存在',
        ];
    }
}

